package mysql

import "gorm.io/gorm"

type Order struct {
	gorm.Model
	OrderSn string  `gorm:"type:char(36);not null;comment:订单编号"`
	UserId  int     `gorm:"type:int(11);not null;comment:用户ID"`
	Amount  float64 `gorm:"type:decimal(10,2);not null;comment:总金额"`
	Payment int     `gorm:"type:tinyint(1);not null;comment:支付方式"`
	Status  int     `gorm:"type:tinyint(1);not null;comment:支付状态"`
}

func (o *Order) Create() error {
	return Db.Create(&o).Error
}
